package com.zjj.lbw.microservice.rpc.dubbo.dubboprovider.service;

import com.zjj.lbw.service.api.user.dubbo.UserDubboApi;
import com.zjj.lbw.service.api.user.entity.User;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.Arrays;
import java.util.List;

/**
 * @author zhanglei.zjj
 * @description dubbo服务实现
 * @date 2023/7/10 21:29
 */
@DubboService
public class UserServiceImpl implements UserDubboApi {
    @Override
    public List<User> list() {
        User u1 = User.builder().id(1).name("子坚君").build();
        User u2 = User.builder().id(2).name("zjj").build();
        return Arrays.asList(u1, u2);
    }

    @Override
    public User getById(Integer id) {
        return User.builder().id(id).name("zjj" + id).build();
    }
}
